package com.dong.jdk8.lambda;

import java.util.Arrays;
import java.util.function.Consumer;

/**
 * Created by jianyang206881 on 2017/9/25.
 */
public class ListLambda {

    public static void main(String[] args) {
        String separator = ",";
        Arrays.asList("a", "b", "d").forEach( (String e) -> System.out.print(e + separator));

        Arrays.asList("a", "b", "d").forEach(new Consumer<String>() {
            @Override
            public void accept(String s) {
                System.out.print(s + separator);
            }
        });
    }

}
